package alt.fr.ma.np.activities;

import alt.fr.ma.np.R;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.Display;
import android.view.Surface;
import android.view.View;
import android.view.WindowManager;

public class AgendaActivity extends CustomTitleActivity {

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE))
				.getDefaultDisplay();

		this.title.setText("Agenda");
		this.title.setCompoundDrawablesWithIntrinsicBounds(
				R.drawable.barrehautagendas, 0, 0, 0);
		this.profile.setImageResource(R.drawable.default_profile);

		switch (display.getRotation()) {
		case Surface.ROTATION_0:
			setContentView(R.layout.agenda);
			break;
		case Surface.ROTATION_90:
			setContentView(R.layout.agenda_landscape);
			break;
		case Surface.ROTATION_180:
			break;
		case Surface.ROTATION_270:
			break;
		}
	}
	
	@Override
	public void onBackPressed() {
		startActivity(new Intent(this, MainActivity.class));
		finish();
	}

	public void addEventAction(View view) {
		switch (view.getId()) {
		case R.id.addEventButton:			
			startActivity(new Intent(this, AddEventActivity.class));
			break;			
		}
	}
}
